// 请求接口数据
import { getRolelist } from "../../../require/api";

const state = {
    roleList: []
};
const getters = {
    getRole(state) {
        return state.roleList
    }
}
const mutations = {
    GRTROLELIST(state, payload) {
        state.roleList = payload
    }
}
const actions = {
    getRoleAction({ commit }) {
        //    列表接口
        getRolelist().then((res) => {
            // console.log(res);
            commit("GRTROLELIST", res.list)
        })

    }

}
export default {
    state,
    getters,
    mutations,
    actions,
    //命名空间
    namespaced: true,
};


